package com.taiji.dicom4cloud.smart.controller;

import com.taiji.dicom4cloud.common.core.utils.R;
import com.taiji.dicom4cloud.smart.service.OrgService;
import com.taiji.dicom4cloud.smart.service.ReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName ReportController
 * @Description
 * @Author HX
 * @Date 2021/8/13 17:27
 **/
@RestController
@RequiredArgsConstructor
@RequestMapping("/report" )
@Api(value = "report", tags = "统计报表")
public class ReportController {


    @Autowired
    private ReportService reportService;

    @ApiOperation(value = "业务统计", notes = "业务统计")
    @GetMapping
    public R getBusinessTotal(@RequestParam("orgId") String orgId){
        return R.ok(reportService.getBusinessTotal(orgId));
    }

    @ApiOperation(value = "车辆入网统计", notes = "车辆入网统计")
    @GetMapping("/car-report")
    public R getCarReport(){
        return R.ok(reportService.getOrgCarTotal());
    }

    @ApiOperation(value = "报警统计", notes = "报警统计")
    @GetMapping("/alarm-report")
    public R getAlarmReport(){
        return R.ok(reportService.getAlarmReport());
    }

    @ApiOperation(value = "报警设备分布", notes = "报警设备分布")
    @GetMapping("/dis")
    public R getAlarmDistribution(@RequestParam("orgId") String orgId){
        return R.ok(reportService.getAlarmDistribution(orgId));
    }

}
